Register Allocation by Proof Transformation

نویسنده

  • Atsushi Ohori
چکیده

This paper presents a proof-theoretical framework for register allocation that accounts for the entire process of register allocation. Liveness analysis is proof reconstruction (similar to type inference), and register allocation is proof transformation from a proof system with unrestricted variable accesses to the one with restricted variable access. In our framework, the set of registers acts as the “working set” of the live variables at each instruction step, which changes during the execution of the code. This eliminates the ad-hoc notion of “spilling”. The necessary memory-register moves are systematically incorporated in the proof transformation process. Its correctness is a simple corollary of our construction; the resulting proof is equivalent to the proof of the original code modulo the treatment of structural rules. This yields a simple yet powerful register allocation algorithm. The algorithm has been implemented, demonstrating the feasibility of the framework. DRAFT. Comments are welcome.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Credible Compilation with Pointers

This paper presents the formal foundations and architectural design of a credible compiler, or a compiler that, in addition to a transformed program, produces a proof that the transformed program correctly implements the original input program. In our design, programs are represented using a standard low-level intermediate form based on controlow graphs. The compiler is structured as a set of c...

متن کامل

Register Allocation: What Does the NP-Completeness Proof of Chaitin et al. Really Prove? Or Revisiting Register Allocation: Why and How

Register allocation is one of the most studied problems in compilation. It is considered as an NP-complete problem since Chaitin et al., in 1981, modeled the problem of assigning temporary variables to k machine registers as the problem of coloring, with k colors, the interference graph associated to the variables. The fact that the interference graph can be arbitrary proves the NP-completeness...

متن کامل

Register Allocation : What does the NP - completeness Proof of Chaitin et al . Really Prove ?

Register allocation is one of the most studied problems in compilation. It is considered as an NP-complete problem since Chaitin et al., in 1981, modeled the problem of assigning temporary variables to k machine registers as the problem of coloring, with k colors, the interference graph associated to the variables. The fact that the interference graph can be arbitrary proves the NP-completeness...

متن کامل

Validating Register Allocation and Spilling

Following the translation validation approach to highassurance compilation, we describe a new algorithm for validating a posteriori the results of a run of register allocation. The algorithm is based on backward dataflow inference of equations between variables, registers and stack locations, and can cope with sophisticated forms of spilling and live range splitting, as well as many forms of ar...

متن کامل

A Proof-Producing Software Compiler for a Subset of Higher Order Logic

We discuss a proof-producing compiler which translates first order recursion equations, defined in higher order logic, to assembly language. The front end of the compiler is based on a series of source-tosource translations, starting with a semantic CPS translation and culminating in graph-colouring register allocation. Equality of the original program and the result of register allocation is p...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2003